package com.yjc.drygoods.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yjc.common.utils.PageUtils;
import com.yjc.common.vo.ConsumeAttentionCountRelationVo;
import com.yjc.drygoods.order.vo.*;
import com.yjc.drygoods.order.entity.OrderEntity;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author yjc
 * @email yjc19979401754@126.com
 * @date 2022-08-19 23:20:12
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 进入结算页
     *
     * @return
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 提交订单
     *
     * @param submitVo
     * @return
     */
    OrderSubmitRespVo submitOrder(OrderSubmitVo submitVo);

    OrderEntity getOrderInfoByOrderSn(String orderSn);

    /**
     * 取消订单
     * @param order
     */
    void closeOrder(OrderEntity order);

    PayVo getPayVo(String orderSn);

    /**
     * 根据条件查询订单并携带订单所有的订单项
     * @param params
     * @return
     */
    PageUtils listWithOrderItems(Map<String, Object> params);

    String handleOrderStatus(PayAsyncVo payAsyncVo);

    List<ConsumeAttentionCountRelationVo> getEveryoneConsumeTotal(List<Long> memberIds);

    /**
     * 修改订单评论时间
     * @param orderSn
     */
    void updateOrderCommentTime(String orderSn);

    List<OrderEntity> getAllOrderWithOrderItems();
}

